package com.fengxing.ams.web.facade.mouble.upload;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

public interface IUploadDAO extends PagingAndSortingRepository<UploadVO, Integer>, JpaSpecificationExecutor<UploadVO>  {

	@Query(value="select * from zyt_upload  where type = :type order by upload_time desc", nativeQuery=true)
	List<UploadVO> findAllSortByUploadTime(@Param("type")String type);

	@Query(value="select * from zyt_upload where status = '未处理' order by upload_time", nativeQuery=true)
	List<UploadVO> queryUploadsForParse();

	@Modifying
	@Query(value="update zyt_upload set status=:status, remark=:remark where id=:id", nativeQuery=true)
	void updateUploadStatusAndRemark(@Param("id")Integer id, @Param("status")String status, @Param("remark")String remark);

//	@Query(value="select * from zyt_order_history where student_id=:student_id order by create_date desc", nativeQuery=true)
//	List<OrderHistoryVO> queryTimeLineByStudentId(@Param("student_id")String studentId);
	
}
